package com.jintian.smart.kernel.redis.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Redisson配置映射类
 */
@ConfigurationProperties(prefix = "spring.redis")
public class RedissonProperties {
    private String host;

    private Integer port;
    /**
     * 连接类型，支持standalone-单机节点，sentinel-哨兵，cluster-集群，masterslave-主从
     */
    private String type = "standalone";
    /**
     * redis连接密码
     */
    private String password;
    /**
     * 选取数据库
     */
    private int database = 0;

    private int pingInterval = 30;

    private int minIdleSize = 5;

    private int poolSize = 10;

    private int nettyThreads = Runtime.getRuntime().availableProcessors();

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getAddress() {
        return host + ":" + port;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getDatabase() {
        return database;
    }

    public void setDatabase(int database) {
        this.database = database;
    }

    public int getPingInterval() {
        return pingInterval;
    }

    public void setPingInterval(int pingInterval) {
        this.pingInterval = pingInterval;
    }

    public int getMinIdleSize() {
        return minIdleSize;
    }

    public void setMinIdleSize(int minIdleSize) {
        this.minIdleSize = minIdleSize;
    }

    public int getPoolSize() {
        return poolSize;
    }

    public void setPoolSize(int poolSize) {
        this.poolSize = poolSize;
    }

    public int getNettyThreads() {
        return nettyThreads;
    }

    public void setNettyThreads(int nettyThreads) {
        this.nettyThreads = nettyThreads;
    }
}
